//
//  UIAlertController+QYAddAction.h
//  CarPooling
//
//  Created by Dxc_iOS on 2018/5/31.
//  Copyright © 2018年 代星创. All rights reserved.
//

#import <UIKit/UIKit.h>

 /**
 封装系统警示弹框 添加 ActionSheet
 */



typedef NS_ENUM(NSInteger, AlertActionStyle) {
    ActionStyleDefault = 0,
    ActionStyleCancel,
    ActionStyleDestructive
};

typedef void (^TextFiledHanler)(NSString * _Nullable text);

@interface UIAlertController (QYAddAction)




/**
 默认 UIAlertAction

 @param title 标题
 @param handler 处理事件
 */
- (void)addAlertDefaultActionWithTitle:(NSString *_Nullable)title
                               handler:(void (^_Nullable)(UIAlertAction * _Nullable  action))handler;




/**
 自定义的UIAlertAction

 @param title 标题
 @param actionStyle alertAction类型 (ActionStyleDefault / ActionStyleCancel / ActionStyleDestructive)
 @param handler 处理事件
 */
- (void)addAlertActionWithTitle:(NSString *_Nullable)title
                    actionStyle:(AlertActionStyle)actionStyle
                        handler:(void (^ __nullable)(UIAlertAction * _Nullable action))handler;



/**
 带输入框的Alert弹框

 @param placeholder TextField占位字符
 @param secureTextEntry TextField是否是密文
 @param textHandler 获取文字处理事件
 */
- (void)addTextFieldWithPlaceholder:(NSString *_Nullable)placeholder
                    secureTextEntry:(BOOL)secureTextEntry
                        textHandler:(TextFiledHanler _Nullable )textHandler;


/**
 带输入框的Alert弹框
 
 @param placeholder TextField占位字符
 @param secureTextEntry TextField是否是密文
 @param textFiledhandler 处理事件
 */
- (void)addTextFieldWithPlaceholder:(NSString *_Nullable)placeholder
                    secureTextEntry:(BOOL)secureTextEntry
                   textFiledhandler:(void(^_Nullable)(UITextField * _Nonnull textField))textFiledhandler;
@end
